<%@ page import="org.apache.commons.codec.binary.Base64" %>
<%--
  Created by IntelliJ IDEA.
  User: hedingwei
  Date: 6/17/15
  Time: 9:54 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="am" uri="http://pm.ambimmort.com/app/tags" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title></title>
    <%--<meta http-equiv="refresh" content="30">--%>

    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

    <!-- Bootstrap Core CSS -->
    <link href="${ctxStatic}/css/bootstrap.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link href="${ctxStatic}/css/plugins/dataTables.bootstrap.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${ctxStatic}/css/smartech.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${ctxStatic}/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- Animate CSS -->
    <link href="${ctxStatic}/css/animate.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="${ctxStatic}/js/html5shiv.js"></script>
    <script src="${ctxStatic}/js/respond.min.js"></script>
    <![endif]-->

    <style type="text/css">
        .table{ width:100% !important; font-size: 13px;}
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            vertical-align: middle;
        }
        .form-actions{margin-top: 0; padding: 0px; margin-bottom: 0;}
        /*.mgl5 {margin-left: 5px;}*/
        .btn{float:right !important; margin-right: 20px !important;}
    </style>
</head>
<body>

<div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <sys:header/>
        <!-- /.navbar-top-links -->

        <sys:sidebar menuId="5100"/>
        <!-- /.navbar-static-side -->
    </nav>

    <div id="page-wrapper">

        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="margin-none">
                            <i class="fa fa-tasks fa-fw"></i> 长时任务管理中心
                        </h4>
                    </div><!-- /.panel-header -->
                    <div class="panel-body">

                        <table class="table table-primary table-bordered table-striped table-hover table-condensed">
                            <thead>
                            <tr>
                                <th style="width: 10px">#</th>

                                <th><i class="icon-caret-right green"></i> 任务</th>
                                <th><i class="icon-caret-right green"></i> 总执行次数</th>
                                <th><i class="icon-caret-right green"></i> 当前状态</th>
                                <th><i class="icon-caret-right green"></i> 当前进度</th>
                                <th><i class="icon-caret-right green"></i> 计划任务</th>
                                <th><i class="icon-caret-right green"></i> 下次执行时间</th>

                                <th style="width: 60px"><i class="icon-caret-right green"></i> 操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${lttasks}" varStatus="i" var="taskBean">
                                <tr>
                                    <td>${i.index+1}.</td>

                                    <td> <a href="${ctx}/f/lttask/init.view.do?taskId=${taskBean.taskId}">${taskBean.name}</a></td>
                                    <td>${taskBean.totalTimes}</td>
                                    <td><span class="badge bg-red">${taskBean.status}</span></td>
                                    <td>
                                        <div class="progress progress-nimi active">
                                            <div class="progress-bar progress-bar-primary" style="width: ${taskBean.progress}%"></div>
                                        </div>
                                    </td>
                                    <td><span class="badge badge-yellow">${taskBean.cron}</span></td>
                                    <td><am:timestamp-format timestamp="${taskBean.nextScheduledTime}" format="yyyy-MM-dd HH:mm:ss"/></td>


                                    <td>
                                        <a href="${ctx}/f/lttask/loglist.view.do?taskId=${taskBean.taskId}" class="appendBreadcrumb">日志</a></td>
                                </tr>

                            </c:forEach>

                            </tbody>
                        </table>

                    </div><!-- /.panel-body -->
                </div>
            </div>

        </div>

        <div class="text-center margin-top footer">&copy; 2015北京坤腾畅联科技有限公司  版权所有</div>

    </div>

</div>

<!-- jQuery Version 1.11.0 -->
<script src="${ctxStatic}/js/jquery-1.11.0.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="${ctxStatic}/js/bootstrap.min.js"></script>
<script src="${ctxStatic}/js/plugins/layer/layer.js"></script>
<!-- DataTables JavaScript -->
<script src="${ctxStatic}/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${ctxStatic}/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<!-- Custom Theme JavaScript -->
<script src="${ctxStatic}/js/smartech.js"></script>

<script>
    $(function(){
         $(".table").dataTable({
             "bSort": false,
             "bLengthChange": false,
             "bFilter": false,
             "language": {
                 "url": "${ctxStatic}/js/Chinese.json"
             }
        });

    });
</script>
</body>
</html>
